// 收集所有的 group
export function collectGroups(arr: any[]) {
  const result: any[] = [];
  arr.forEach((item) => {
    result.push({ name: item.group, disabled: false });
  });
  // return arr.map((item) => item.group);
  return result;
}

// 收集所有用户所在的组
export function collectUserGroups(arr: any[]) {
  const result: any[] = [];
  arr.forEach((item) => {
    item.user.forEach((user: any) => {
      result.push({ name: user, group: item.group, disabled: false });
    });
  });
  return result;
}
